From e6e85b662be9eab96f4cfc58e9945580cce8b2bb Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 10 Nov 2020 14:40:09 +0100 Subject: [PATCH] x86/CPUID: also check leaf 7 max subleaf to be compatible Just like is done for basic and extended major leaves. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- xen/lib/x86/policy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/lib/x86/policy.c b/xen/lib/x86/policy.c index 4beca8767a..f6cea4e2f9 100644 --- a/xen/lib/x86/policy.c +++ b/xen/lib/x86/policy.c @@ -18,6 +18,9 @@ int x86_cpu_policies_are_compatible(const struct cpu_policy *host, if ( guest->cpuid->basic.max_leaf > host->cpuid->basic.max_leaf ) FAIL_CPUID(0, NA); + if ( guest->cpuid->feat.max_subleaf > host->cpuid->feat.max_subleaf ) + FAIL_CPUID(7, 0); + if ( guest->cpuid->extd.max_leaf > host->cpuid->extd.max_leaf ) FAIL_CPUID(0x80000000, NA); -- 2.30.2